// component/head/head.js
let search;
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    setting:{
      type:Object,
      value: {}
    },
    naxtTeamplat: {
      type:Object,
      value: {}
    }
  },
  ready: function ()  {
    var that = this;
    that.setData({
      store: wx.getStorageSync('store'),
      shop: wx.getStorageSync('address_info'),
      __wxapp_img: wx.getStorageSync('wxapp_img'),
      headheight: wx.getStorageSync('headheight')
    })
  },

  /**
   * 组件的初始数据
   */
  data: {
    top: 0
  },

  /**
   * 组件的方法列表
   */
  methods: {
    setOpacity: function (s) {
      if (this.data.top < 25 || s<50) {
        var top = 0;
        if (s < 40) {
            top = s * 25 / 40;
            wx.setNavigationBarColor({
              frontColor: '#ffffff',
              backgroundColor: '#ffffff'
            });
        }else {
            top = 25;
            wx.setNavigationBarColor({
              frontColor: '#000000',
              backgroundColor: '#ffffff'
            });
        }
        this.setData({
          top: top
        })
      }
    }
  }
})
